🎖️GitЯра🎖️
Node / meshtastic / Meshtastic-Android / files / feature / settings / src / commonMain / kotlin / org / meshtastic / feature / settings / radio / component / EditDeviceProfileDialog.kt
Displaying Raw • Download
feature/settings/src/commonMain/kotlin/org/meshtastic/feature/settings/radio/component/EditDeviceProfileDialog.kt cd1ebd1ec1470b3968fb7aedfc69975b1b0be5f3 (cd1ebd1e) Text, 6.69 KB
T8b949e/*
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
Tff7b72package T7ee787org.meshtastic.feature.settings.radio.component
Tff7b72import T7ee787androidx.compose.foundation.layout.Column
Tff7b72import T7ee787androidx.compose.foundation.layout.PaddingValues
Tff7b72import T7ee787androidx.compose.foundation.layout.fillMaxWidth
Tff7b72import T7ee787androidx.compose.material3.HorizontalDivider
Tff7b72import T7ee787androidx.compose.runtime.Composable
Tff7b72import T7ee787androidx.compose.runtime.mutableStateMapOf
Tff7b72import T7ee787androidx.compose.runtime.remember
Tff7b72import T7ee787androidx.compose.ui.Modifier
Tff7b72import T7ee787androidx.compose.ui.unit.dp
Tff7b72import T7ee787org.jetbrains.compose.resources.StringResource
Tff7b72import T7ee787org.jetbrains.compose.resources.stringResource
Tff7b72import T7ee787org.meshtastic.core.resources.Res
Tff7b72import T7ee787org.meshtastic.core.resources.cancel
Tff7b72import T7ee787org.meshtastic.core.resources.channel_url
Tff7b72import T7ee787org.meshtastic.core.resources.fixed_position
Tff7b72import T7ee787org.meshtastic.core.resources.licensed_amateur_radio
Tff7b72import T7ee787org.meshtastic.core.resources.long_name
Tff7b72import T7ee787org.meshtastic.core.resources.module_settings
Tff7b72import T7ee787org.meshtastic.core.resources.radio_configuration
Tff7b72import T7ee787org.meshtastic.core.resources.save
Tff7b72import T7ee787org.meshtastic.core.resources.short_name
Tff7b72import T7ee787org.meshtastic.core.resources.unmessageable
Tff7b72import T7ee787org.meshtastic.core.ui.component.MeshtasticDialog
Tff7b72import T7ee787org.meshtastic.core.ui.component.SwitchPreference
Tff7b72import T7ee787org.meshtastic.proto.DeviceProfile
Tff7b72private Tff7b72const Tff7b72val Te6edf3UNMESSAGABLE_TAG Tff7b72= T79c0ff9
Tff7b72private Tff7b72const Tff7b72val Te6edf3LICENSED_TAG Tff7b72= T79c0ff1T79c0ff0
Tff7b72private Tff7b72enum Tff7b72class T56d364ProfileFieldTb4b4b4(Tff7b72val Te6edf3tagTb4b4b4: Tffa657IntTb4b4b4, Tff7b72val Te6edf3labelResTb4b4b4: Te6edf3StringResourceTb4b4b4) Tb4b4b4{
Te6edf3LONG_NAMETb4b4b4(T79c0ff1Tb4b4b4, Te6edf3ResTb4b4b4.Te6edf3stringTb4b4b4.Te6edf3long_nameTb4b4b4)Tb4b4b4,
Te6edf3SHORT_NAMETb4b4b4(T79c0ff2Tb4b4b4, Te6edf3ResTb4b4b4.Te6edf3stringTb4b4b4.Te6edf3short_nameTb4b4b4)Tb4b4b4,
Te6edf3CHANNEL_URLTb4b4b4(T79c0ff3Tb4b4b4, Te6edf3ResTb4b4b4.Te6edf3stringTb4b4b4.Te6edf3channel_urlTb4b4b4)Tb4b4b4,
Te6edf3CONFIGTb4b4b4(T79c0ff4Tb4b4b4, Te6edf3ResTb4b4b4.Te6edf3stringTb4b4b4.Te6edf3radio_configurationTb4b4b4)Tb4b4b4,
Te6edf3MODULE_CONFIGTb4b4b4(T79c0ff5Tb4b4b4, Te6edf3ResTb4b4b4.Te6edf3stringTb4b4b4.Te6edf3module_settingsTb4b4b4)Tb4b4b4,
Te6edf3FIXED_POSITIONTb4b4b4(T79c0ff6Tb4b4b4, Te6edf3ResTb4b4b4.Te6edf3stringTb4b4b4.Te6edf3fixed_positionTb4b4b4)Tb4b4b4,
Te6edf3UNMESSAGABLETb4b4b4(Te6edf3UNMESSAGABLE_TAGTb4b4b4, Te6edf3ResTb4b4b4.Te6edf3stringTb4b4b4.Te6edf3unmessageableTb4b4b4)Tb4b4b4,
Te6edf3LICENSEDTb4b4b4(Te6edf3LICENSED_TAGTb4b4b4, Te6edf3ResTb4b4b4.Te6edf3stringTb4b4b4.Te6edf3licensed_amateur_radioTb4b4b4)Tb4b4b4,
Tb4b4b4}
Tf0883e@SuppressTb4b4b4(Ta5d6ff"Ta5d6ffLongMethodTa5d6ff"Tb4b4b4, Ta5d6ff"Ta5d6ffCyclomaticComplexMethodTa5d6ff"Tb4b4b4)
Tf0883e@Composable
Tff7b72fun Td2a8ffEditDeviceProfileDialogTb4b4b4(
Te6edf3titleTb4b4b4: Tffa657StringTb4b4b4,
Te6edf3deviceProfileTb4b4b4: Te6edf3DeviceProfileTb4b4b4,
Te6edf3onConfirmTb4b4b4: Tb4b4b4(Te6edf3DeviceProfileTb4b4b4) Tff7b72-Tff7b72> Tffa657UnitTb4b4b4,
Te6edf3onDismissTb4b4b4: Tb4b4b4(Tb4b4b4) Tff7b72-Tff7b72> Tffa657UnitTb4b4b4,
Te6edf3modifierTb4b4b4: Te6edf3Modifier Tff7b72= Te6edf3ModifierTb4b4b4,
Tb4b4b4) Tb4b4b4{
Tff7b72val Te6edf3state Tff7b72= Te6edf3remember Tb4b4b4{
Te6edf3mutableStateMapOfTff7b72<Te6edf3ProfileFieldTb4b4b4, Tffa657BooleanTff7b72>Tb4b4b4(Tb4b4b4)Tb4b4b4.Te6edf3apply Tb4b4b4{
Te6edf3putAllTb4b4b4(
Te6edf3ProfileFieldTb4b4b4.Te6edf3entriesTb4b4b4.Te6edf3associateWith Tb4b4b4{ Te6edf3field Tff7b72-Tff7b72>
Tff7b72when Tb4b4b4(Te6edf3fieldTb4b4b4) Tb4b4b4{
Te6edf3ProfileFieldTb4b4b4.Te6edf3LONG_NAME Tff7b72-Tff7b72> Te6edf3deviceProfileTb4b4b4.Te6edf3long_name Tff7b72!Tff7b72= Tff7b72null
Te6edf3ProfileFieldTb4b4b4.Te6edf3SHORT_NAME Tff7b72-Tff7b72> Te6edf3deviceProfileTb4b4b4.Te6edf3short_name Tff7b72!Tff7b72= Tff7b72null
Te6edf3ProfileFieldTb4b4b4.Te6edf3CHANNEL_URL Tff7b72-Tff7b72> Te6edf3deviceProfileTb4b4b4.Te6edf3channel_url Tff7b72!Tff7b72= Tff7b72null
Te6edf3ProfileFieldTb4b4b4.Te6edf3CONFIG Tff7b72-Tff7b72> Te6edf3deviceProfileTb4b4b4.Te6edf3config Tff7b72!Tff7b72= Tff7b72null
Te6edf3ProfileFieldTb4b4b4.Te6edf3MODULE_CONFIG Tff7b72-Tff7b72> Te6edf3deviceProfileTb4b4b4.Te6edf3module_config Tff7b72!Tff7b72= Tff7b72null
Te6edf3ProfileFieldTb4b4b4.Te6edf3FIXED_POSITION Tff7b72-Tff7b72> Te6edf3deviceProfileTb4b4b4.Te6edf3fixed_position Tff7b72!Tff7b72= Tff7b72null
Te6edf3ProfileFieldTb4b4b4.Te6edf3UNMESSAGABLE Tff7b72-Tff7b72> Te6edf3deviceProfileTb4b4b4.Te6edf3is_unmessagable Tff7b72!Tff7b72= Tff7b72null
Te6edf3ProfileFieldTb4b4b4.Te6edf3LICENSED Tff7b72-Tff7b72> Te6edf3deviceProfileTb4b4b4.Te6edf3is_licensed Tff7b72!Tff7b72= Tff7b72null
Tb4b4b4}
Tb4b4b4}Tb4b4b4,
Tb4b4b4)
Tb4b4b4}
Tb4b4b4}
Te6edf3MeshtasticDialogTb4b4b4(
Te6edf3title Tff7b72= Te6edf3titleTb4b4b4,
Te6edf3onDismiss Tff7b72= Te6edf3onDismissTb4b4b4,
Te6edf3dismissText Tff7b72= Te6edf3stringResourceTb4b4b4(Te6edf3ResTb4b4b4.Te6edf3stringTb4b4b4.Te6edf3cancelTb4b4b4)Tb4b4b4,
Te6edf3confirmText Tff7b72= Te6edf3stringResourceTb4b4b4(Te6edf3ResTb4b4b4.Te6edf3stringTb4b4b4.Te6edf3saveTb4b4b4)Tb4b4b4,
Te6edf3onConfirm Tff7b72= Tb4b4b4{
Tff7b72val Te6edf3result Tff7b72=
Te6edf3DeviceProfileTb4b4b4(
Te6edf3long_name Tff7b72= Tff7b72if Tb4b4b4(Te6edf3stateTff7b72[Te6edf3ProfileFieldTb4b4b4.Te6edf3LONG_NAMETff7b72] Tff7b72=Tff7b72= Tff7b72trueTb4b4b4) Te6edf3deviceProfileTb4b4b4.Te6edf3long_name Tff7b72else Tff7b72nullTb4b4b4,
Te6edf3short_name Tff7b72= Tff7b72if Tb4b4b4(Te6edf3stateTff7b72[Te6edf3ProfileFieldTb4b4b4.Te6edf3SHORT_NAMETff7b72] Tff7b72=Tff7b72= Tff7b72trueTb4b4b4) Te6edf3deviceProfileTb4b4b4.Te6edf3short_name Tff7b72else Tff7b72nullTb4b4b4,
Te6edf3channel_url Tff7b72= Tff7b72if Tb4b4b4(Te6edf3stateTff7b72[Te6edf3ProfileFieldTb4b4b4.Te6edf3CHANNEL_URLTff7b72] Tff7b72=Tff7b72= Tff7b72trueTb4b4b4) Te6edf3deviceProfileTb4b4b4.Te6edf3channel_url Tff7b72else Tff7b72nullTb4b4b4,
Te6edf3config Tff7b72= Tff7b72if Tb4b4b4(Te6edf3stateTff7b72[Te6edf3ProfileFieldTb4b4b4.Te6edf3CONFIGTff7b72] Tff7b72=Tff7b72= Tff7b72trueTb4b4b4) Te6edf3deviceProfileTb4b4b4.Te6edf3config Tff7b72else Tff7b72nullTb4b4b4,
Te6edf3module_config Tff7b72=
Tff7b72if Tb4b4b4(Te6edf3stateTff7b72[Te6edf3ProfileFieldTb4b4b4.Te6edf3MODULE_CONFIGTff7b72] Tff7b72=Tff7b72= Tff7b72trueTb4b4b4) Tb4b4b4{
Te6edf3deviceProfileTb4b4b4.Te6edf3module_config
Tb4b4b4} Tff7b72else Tb4b4b4{
Tff7b72null
Tb4b4b4}Tb4b4b4,
Te6edf3fixed_position Tff7b72=
Tff7b72if Tb4b4b4(Te6edf3stateTff7b72[Te6edf3ProfileFieldTb4b4b4.Te6edf3FIXED_POSITIONTff7b72] Tff7b72=Tff7b72= Tff7b72trueTb4b4b4) Tb4b4b4{
Te6edf3deviceProfileTb4b4b4.Te6edf3fixed_position
Tb4b4b4} Tff7b72else Tb4b4b4{
Tff7b72null
Tb4b4b4}Tb4b4b4,
Te6edf3is_unmessagable Tff7b72=
Tff7b72if Tb4b4b4(Te6edf3stateTff7b72[Te6edf3ProfileFieldTb4b4b4.Te6edf3UNMESSAGABLETff7b72] Tff7b72=Tff7b72= Tff7b72trueTb4b4b4) Te6edf3deviceProfileTb4b4b4.Te6edf3is_unmessagable Tff7b72else Tff7b72nullTb4b4b4,
Te6edf3is_licensed Tff7b72= Tff7b72if Tb4b4b4(Te6edf3stateTff7b72[Te6edf3ProfileFieldTb4b4b4.Te6edf3LICENSEDTff7b72] Tff7b72=Tff7b72= Tff7b72trueTb4b4b4) Te6edf3deviceProfileTb4b4b4.Te6edf3is_licensed Tff7b72else Tff7b72nullTb4b4b4,
Tb4b4b4)
Te6edf3onConfirmTb4b4b4(Te6edf3resultTb4b4b4)
Tb4b4b4}Tb4b4b4,
Te6edf3modifier Tff7b72= Te6edf3modifierTb4b4b4,
Te6edf3text Tff7b72= Tb4b4b4{
Te6edf3ColumnTb4b4b4(Te6edf3modifier Tff7b72= Te6edf3ModifierTb4b4b4.Te6edf3fillMaxWidthTb4b4b4(Tb4b4b4)Tb4b4b4) Tb4b4b4{
Te6edf3HorizontalDividerTb4b4b4(Tb4b4b4)
Te6edf3ProfileFieldTb4b4b4.Te6edf3entriesTb4b4b4.Te6edf3forEach Tb4b4b4{ Te6edf3field Tff7b72-Tff7b72>
Tff7b72val Te6edf3isAvailable Tff7b72=
Tff7b72when Tb4b4b4(Te6edf3fieldTb4b4b4) Tb4b4b4{
Te6edf3ProfileFieldTb4b4b4.Te6edf3LONG_NAME Tff7b72-Tff7b72> Te6edf3deviceProfileTb4b4b4.Te6edf3long_name Tff7b72!Tff7b72= Tff7b72null
Te6edf3ProfileFieldTb4b4b4.Te6edf3SHORT_NAME Tff7b72-Tff7b72> Te6edf3deviceProfileTb4b4b4.Te6edf3short_name Tff7b72!Tff7b72= Tff7b72null
Te6edf3ProfileFieldTb4b4b4.Te6edf3CHANNEL_URL Tff7b72-Tff7b72> Te6edf3deviceProfileTb4b4b4.Te6edf3channel_url Tff7b72!Tff7b72= Tff7b72null
Te6edf3ProfileFieldTb4b4b4.Te6edf3CONFIG Tff7b72-Tff7b72> Te6edf3deviceProfileTb4b4b4.Te6edf3config Tff7b72!Tff7b72= Tff7b72null
Te6edf3ProfileFieldTb4b4b4.Te6edf3MODULE_CONFIG Tff7b72-Tff7b72> Te6edf3deviceProfileTb4b4b4.Te6edf3module_config Tff7b72!Tff7b72= Tff7b72null
Te6edf3ProfileFieldTb4b4b4.Te6edf3FIXED_POSITION Tff7b72-Tff7b72> Te6edf3deviceProfileTb4b4b4.Te6edf3fixed_position Tff7b72!Tff7b72= Tff7b72null
Te6edf3ProfileFieldTb4b4b4.Te6edf3UNMESSAGABLE Tff7b72-Tff7b72> Te6edf3deviceProfileTb4b4b4.Te6edf3is_unmessagable Tff7b72!Tff7b72= Tff7b72null
Te6edf3ProfileFieldTb4b4b4.Te6edf3LICENSED Tff7b72-Tff7b72> Te6edf3deviceProfileTb4b4b4.Te6edf3is_licensed Tff7b72!Tff7b72= Tff7b72null
Tb4b4b4}
Te6edf3SwitchPreferenceTb4b4b4(
Te6edf3title Tff7b72= Te6edf3stringResourceTb4b4b4(Te6edf3fieldTb4b4b4.Te6edf3labelResTb4b4b4)Tb4b4b4,
Te6edf3checked Tff7b72= Te6edf3stateTff7b72[Te6edf3fieldTff7b72] Tff7b72=Tff7b72= Tff7b72trueTb4b4b4,
Te6edf3enabled Tff7b72= Te6edf3isAvailableTb4b4b4,
Te6edf3onCheckedChange Tff7b72= Tb4b4b4{ Te6edf3stateTff7b72[Te6edf3fieldTff7b72] Tff7b72= Tffa657it Tb4b4b4}Tb4b4b4,
Te6edf3padding Tff7b72= Te6edf3PaddingValuesTb4b4b4(T79c0ff0.Te6edf3dpTb4b4b4)Tb4b4b4,
Tb4b4b4)
Tb4b4b4}
Te6edf3HorizontalDividerTb4b4b4(Tb4b4b4)
Tb4b4b4}
Tb4b4b4}Tb4b4b4,
Tb4b4b4)
Tb4b4b4}
Served by rngit 1.5.0 - Generated in 0.06s